from django.db import models
from django.utils.timezone import now


class User(models.Model):
    username = models.CharField(max_length=30)
    phone = models.CharField(max_length=11)
    password = models.CharField(max_length=256)
    create_time = models.DateTimeField(default=now)
    last_login = models.DateTimeField(default=now)
    is_staff = models.BooleanField(default=False, verbose_name='是否是管理员')
    is_activated = models.BooleanField(default=True, verbose_name='是否激活管理员权限')
    email = models.EmailField(default=None)

    def __str__(self):
        return self.username

    class Meta:
        db_table = 'user'













